<?php

namespace app\admin\model;

use think\Model;

/**
 * 学历要求
 * Class EducationRequirement
 * @package app\admin\model
 */
class EducationRequirement extends Model
{
    /**
     * 指定学历要求字段值
     * @param $where
     * @param $field
     * @return mixed
     */
    public static function findEducationRequirementValue($where, $field)
    {
        return self::where($where)->value($field);
    }

    /**
     * 所有学历要求
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function getEducationRequirement()
    {
        $data = self::where(['status' => 1])->select();

        return $data ? $data->toArray() : [];
    }
}